@echo off
setlocal enabledelayedexpansion

 set groupid=
 for /f %%i in ('findstr /L  "groupId" "pom.xml"') do (
   if defined groupid (
   echo "0"
   ) else (
     echo 1
     set newname=%%i
     set groupid=!newname:^<groupId^>=!
     set groupid=!groupid:^<^/groupId^>=!
   )
 )

echo !groupid!

if NOT %groupid%==cloud.maque.tool (

    echo ==========================edit xml==========================
    powershell -Command "&{Set-ExecutionPolicy UnRestricted}"
    for /r  %%f in (pom.xml*) do (
       powershell ./new.ps1 %%f %groupid%
       echo finish %%f
    )


     echo ==========================edit factories==========================
     for /r  %%f in (spring.factories*) do (
           powershell ./new.ps1 %%f %groupid%
           echo finish %%f
     )
)

